import request from '@/utils/request'

//查询商品及其详情信息 错误:没有return
// export function getProductList4(query){
//   request({
//     url: '/api/product/list/getProductList',
//     method: 'get',
//     query: query
//   })
// }
//获取商品基本信息
export function getProductList(query) {
  return request({
    url: '/api/product/list/getProductList',
    method: 'get',
    params: query
  })
}

//获取商品详情信息
export function getProductDetailList(query) {
  return request({
    url: '/api/product/list/getProductDetailList?prodId='+query,
    method: 'get'
  })
}

export function addProduct(data){
  const params = {
    addInfo: data
  }
  return request({
    url: '/api/product/list/addProduct',
    method: 'post',
    data: params
  })
}

//获取商品销售信息
export function getOrderData(){
  return request({
    url: '/api/product/list/getOrderData',
    method: 'post'
  })
}

//更新商品信息
export function updateProduct(date){
  console.log(date)
  const params = {
    updateInfo: date
  }
  return request({
    url: '/api/product/list/updateProduct',
    method: 'post',
    data: params
  })
}

//改变基本表商品状态
export function changeProdStatus(prodId, status){
  const data = {
    prodId: prodId,
    status: status
  }
  return request({
    url: '/api/product/list/changeProdStatus',
    method: 'get',
    params: data
  })
}

//导出表格
export function exportProduct(prodIds){
  const data = {
    prodIds: prodIds
  }
  return request({
    url: '/api/product/list/exportProduct',
    method: 'post',
    data: data
  })
}

// getProductDetailList
